xdsclient: fix panic on empty resource in ADS response#8970
xdsclient: fix panic on empty resource in ADS response#8970Pranjali-2501 merged 6 commits intogrpc:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8970 +/- ##
==========================================
+ Coverage 82.67% 83.11% +0.43%
==========================================
Files 410 411 +1
Lines 32573 32715 +142
==========================================
+ Hits 26929 27190 +261
- Misses 4055 4149 +94
+ Partials 1589 1376 -213
🚀 New features to boost your workflow:
|
|
Please also add a release note mentioning the bug fix. |
|
I just happened to look at this PR by chance. Since @arjan-bal is already reviewing it, I'll leave it to him. I don't want both of us spending time on the PR. Thanks. |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request addresses a panic that can occur when processing an xDS ADS response with an empty resource name. The core of the fix is the addition of validation checks in the unmarshalling functions for CDS, EDS, LDS, and RDS resources to ensure resource names are not empty. A defensive check has also been added in decodeResponse to handle cases where a resource decoder might incorrectly return a nil result and nil error, preventing a potential panic. The decodeResponse function has been refactored into a method on xdsChannel for better encapsulation. All related tests have been updated to reflect these changes, including new test cases for empty resource names, ensuring the fix is well-covered. The changes are correct and improve the robustness of the xdsclient.
This PR fixes an intermittent panic in xdsclient
decodeResponsethat occurs when processing an xDS ADS response containing an empty resource name, while doing fuzz testing.RELEASE NOTES: